﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="AdminChangePW.aspx.vb"
    Inherits="QLThuVien.AdminChangePW" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function OnCheckPassword(s, e) {
            var pw = mypw.GetText();
            var repw = e.value;
            if (repw == null)
                return;
            if (repw != pw) {
                e.isValid = false;
                e.errorText = "Mật Khẩu Không Khớp";
            }
        }
        function ClearAllText(s, e) {
            ASPxClientEdit.ClearEditorsInContainerById('container');
        }
        function HideSuccess() {
            var seconds = 4;
            setTimeout(function () {
                document.getElementById('successDiv').style.display = "none";
            }, seconds * 1000);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="row" id="container">
                <div class="col-lg-12">
                    <div class="form-group">
                        <label>
                            Mật Khẩu Cũ:</label>
                        <dx:ASPxTextBox ID="tb_matkhaucu" runat="server" CssClass="form-control" Password="true" 
                            Width="100%">
                            <ValidationSettings ErrorTextPosition="Bottom" SetFocusOnError="true">
                                <RequiredField ErrorText="Chưa Nhập Mật Khẩu Cũ" IsRequired="True" />
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </div>
                    <div class=" form-group">
                        <label>
                            Mật Khẩu Mới:</label>
                        <dx:ASPxTextBox ID="tb_matkhaumoi" runat="server" CssClass="form-control" Password="true" ClientInstanceName="mypw"
                            Width="100%">
                           
                            <ValidationSettings ErrorTextPosition="Bottom" SetFocusOnError="true">
                                <RequiredField ErrorText="Chưa Nhập Mật Khẩu Mới" IsRequired="True" />
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </div>
                    <div class=" form-group">
                        <label>
                            Nhập Lại:</label>
                        <dx:ASPxTextBox ID="tb_nhaplai" runat="server" CssClass="form-control" Password="true" ClientInstanceName="repw"
                            Width="100%">
                             <ClientSideEvents Validation="OnCheckPassword" />
                            <ValidationSettings ErrorTextPosition="Bottom" SetFocusOnError="true">
                                <RequiredField ErrorText="Chưa Nhập Lại" IsRequired="True" />
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </div>
                    <div class="form-group">
                        <dx:ASPxButton ID="btn_xacnhan" runat="server" Text="Xác Nhận" CssClass="btn btn-primary" ClientInstanceName="btn_xacnhan" 
                            AutoPostBack="True">
                            <ClientSideEvents Click="function(s,e){HideSuccess()}"/>
                        </dx:ASPxButton>
                        <dx:ASPxButton ID="btn_hoantac" runat="server" Text="Hoàn Tác" CssClass="btn btn-danger" ClientInstanceName="btn_hoantac" ClientSideEvents-Click="ClearAllText" >
                        </dx:ASPxButton>
                        <div class="alert alert-success" runat="server" id="successDiv" visible="false" clientidmode="Static" >
                                <dx:ASPxLabel ID="lb_mess" runat="server" Font-Bold="true">
                                </dx:ASPxLabel>
                            </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
